package com.nbst.comnutil;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 
 * @ClassName: LogOut
 * @Description: 注入日志服务
 * @author King
 * @date 2018-8-24
 * 
 */
@Component
public class LogOut {
	@Autowired
	serverConf conf;
	private Logger logger = LoggerFactory.getLogger(LogOut.class);

	public void info(String msg) {
		logger.info(conf.getServername() + " - " + msg);
	}

	public void error(Throwable e) {
		logger.error(conf.getServername() + "捕获异常:", e);
	}

	public void debug(String msg) {
		logger.debug(conf.getServername() + " - " + msg);
	}

	public void warn(String msg) {
		logger.warn(conf.getServername() + " - " + msg);
	}

	public void error(String message) {
		logger.error(conf.getServername() + "捕获异常:", message);
	}
}
